import { MigrationInterface, QueryRunner } from "typeorm";

export class AddClassFeatures1746363430378 implements MigrationInterface {
    name = 'AddClassFeatures1746363430378'

    public async up(queryRunner: QueryRunner): Promise<void> {
        await queryRunner.query(`
            ALTER TABLE \`sys_refresh_tokens\` DROP FOREIGN KEY \`FK_1dfd080c2abf42198691b60ae39\`
        `);
        await queryRunner.query(`
            ALTER TABLE \`sys_access_tokens\` DROP FOREIGN KEY \`FK_e9d9d0c303432e4e5e48c1c3e90\`
        `);
        await queryRunner.query(`
            DROP INDEX \`REL_1dfd080c2abf42198691b60ae3\` ON \`sys_refresh_tokens\`
        `);
        await queryRunner.query(`
            DROP INDEX \`IDX_9e7164b2f1ea1348bc0eb0a7da\` ON \`sys_user\`
        `);
        await queryRunner.query(`
            DROP INDEX \`idx_task_id\` ON \`sys_asr_task\`
        `);
        await queryRunner.query(`
            DROP INDEX \`idx_url\` ON \`sys_asr_task\`
        `);
        await queryRunner.query(`
            DROP INDEX \`idx_class_id\` ON \`c_class\`
        `);
        await queryRunner.query(`
            DROP INDEX \`idx_student_id\` ON \`c_student_expire_log\`
        `);
        await queryRunner.query(`
            DROP INDEX \`idx_student_phone\` ON \`c_student\`
        `);
        await queryRunner.query(`
            DROP INDEX \`idx_class_id\` ON \`c_student_class\`
        `);
        await queryRunner.query(`
            DROP INDEX \`idx_student_id\` ON \`c_student_class\`
        `);
        await queryRunner.query(`
            DROP INDEX \`idx_c_student_phone\` ON \`c_user\`
        `);
        await queryRunner.query(`
            DROP INDEX \`idx_c_user_id\` ON \`c_user\`
        `);
        await queryRunner.query(`
            DROP INDEX \`idx_created_at\` ON \`c_user_history\`
        `);
        await queryRunner.query(`
            DROP INDEX \`idx_editor_id\` ON \`c_user_history\`
        `);
        await queryRunner.query(`
            DROP INDEX \`idx_user_id\` ON \`c_user_history\`
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_student\` DROP COLUMN \`join_at\`
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_user\` DROP COLUMN \`age\`
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_class\`
            ADD \`study_plan\` text NULL COMMENT '学习计划'
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_student_class\`
            ADD \`join_at\` datetime NULL
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_student_class\`
            ADD \`checkin_days\` int NOT NULL COMMENT '打卡天数' DEFAULT '0'
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_student_class\`
            ADD \`last_checkin_at\` datetime NULL COMMENT '上次打卡时间'
        `);
        await queryRunner.query(`
            ALTER TABLE \`sys_menu\` CHANGE \`create_by\` \`create_by\` int NULL COMMENT '创建者'
        `);
        await queryRunner.query(`
            ALTER TABLE \`sys_menu\` CHANGE \`update_by\` \`update_by\` int NULL COMMENT '更新者'
        `);
        await queryRunner.query(`
            ALTER TABLE \`sys_refresh_tokens\` CHANGE \`accessTokenId\` \`accessTokenId\` varchar(36) NULL
        `);
        await queryRunner.query(`
            ALTER TABLE \`sys_refresh_tokens\`
            ADD UNIQUE INDEX \`IDX_1298b95c8b138ab223bd8c1529\` (\`accessTokenId\`)
        `);
        await queryRunner.query(`
            ALTER TABLE \`sys_user\` CHANGE \`phone\` \`phone\` varchar(255) NOT NULL
        `);
        await queryRunner.query(`
            ALTER TABLE \`sys_user\`
            ADD UNIQUE INDEX \`IDX_7bef5cdb09432b1dfc46a063ce\` (\`phone\`)
        `);
        await queryRunner.query(`
            ALTER TABLE \`sys_role\` CHANGE \`create_by\` \`create_by\` int NULL COMMENT '创建者'
        `);
        await queryRunner.query(`
            ALTER TABLE \`sys_role\` CHANGE \`update_by\` \`update_by\` int NULL COMMENT '更新者'
        `);
        await queryRunner.query(`
            ALTER TABLE \`sys_role\` CHANGE \`value\` \`value\` varchar(255) NOT NULL COMMENT '角色标识'
        `);
        await queryRunner.query(`
            ALTER TABLE \`sys_ocr_task\` CHANGE \`id\` \`id\` bigint UNSIGNED NOT NULL COMMENT '主键'
        `);
        await queryRunner.query(`
            ALTER TABLE \`sys_ocr_task\` DROP PRIMARY KEY
        `);
        await queryRunner.query(`
            ALTER TABLE \`sys_ocr_task\` DROP COLUMN \`id\`
        `);
        await queryRunner.query(`
            ALTER TABLE \`sys_ocr_task\`
            ADD \`id\` int NOT NULL PRIMARY KEY AUTO_INCREMENT
        `);
        await queryRunner.query(`
            ALTER TABLE \`sys_ocr_task\` DROP COLUMN \`is_delete\`
        `);
        await queryRunner.query(`
            ALTER TABLE \`sys_ocr_task\`
            ADD \`is_delete\` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6)
        `);
        await queryRunner.query(`
            ALTER TABLE \`sys_asr_task\` CHANGE \`id\` \`id\` bigint UNSIGNED NOT NULL COMMENT '主键'
        `);
        await queryRunner.query(`
            ALTER TABLE \`sys_asr_task\` DROP PRIMARY KEY
        `);
        await queryRunner.query(`
            ALTER TABLE \`sys_asr_task\` DROP COLUMN \`id\`
        `);
        await queryRunner.query(`
            ALTER TABLE \`sys_asr_task\`
            ADD \`id\` int NOT NULL PRIMARY KEY AUTO_INCREMENT
        `);
        await queryRunner.query(`
            ALTER TABLE \`sys_asr_task\` DROP COLUMN \`is_delete\`
        `);
        await queryRunner.query(`
            ALTER TABLE \`sys_asr_task\`
            ADD \`is_delete\` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6)
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_class\` CHANGE \`id\` \`id\` bigint UNSIGNED NOT NULL COMMENT '主键'
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_class\` DROP PRIMARY KEY
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_class\` DROP COLUMN \`id\`
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_class\`
            ADD \`id\` int NOT NULL PRIMARY KEY AUTO_INCREMENT
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_class\` CHANGE \`class_id\` \`class_id\` varchar(255) NOT NULL
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_class\`
            ADD UNIQUE INDEX \`IDX_66724669c486d7566404765d01\` (\`class_id\`)
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_class\` CHANGE \`class_name\` \`class_name\` varchar(255) NOT NULL
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_class\` CHANGE \`class_teacher\` \`class_teacher\` int NOT NULL COMMENT '带班老师'
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_class\` DROP COLUMN \`status\`
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_class\`
            ADD \`status\` int NOT NULL COMMENT '状态' DEFAULT '1'
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_student_expire_log\` CHANGE \`id\` \`id\` bigint UNSIGNED NOT NULL COMMENT '主键'
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_student_expire_log\` DROP PRIMARY KEY
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_student_expire_log\` DROP COLUMN \`id\`
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_student_expire_log\`
            ADD \`id\` int NOT NULL PRIMARY KEY AUTO_INCREMENT
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_student_expire_log\` DROP COLUMN \`student_id\`
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_student_expire_log\`
            ADD \`student_id\` int NOT NULL
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_student_expire_log\` CHANGE \`start_at\` \`start_at\` datetime NOT NULL
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_student_expire_log\` CHANGE \`expire_at\` \`expire_at\` datetime NOT NULL
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_student\` CHANGE \`id\` \`id\` bigint UNSIGNED NOT NULL COMMENT '主键'
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_student\` DROP PRIMARY KEY
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_student\` DROP COLUMN \`id\`
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_student\`
            ADD \`id\` int NOT NULL PRIMARY KEY AUTO_INCREMENT
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_student\` DROP COLUMN \`is_delete\`
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_student\`
            ADD \`is_delete\` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6)
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_student\` CHANGE \`create_by\` \`create_by\` int NULL COMMENT '创建者'
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_student\` CHANGE \`update_by\` \`update_by\` int NULL COMMENT '更新者'
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_student\` CHANGE \`student_id\` \`student_id\` varchar(255) NOT NULL
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_student\` CHANGE \`phone\` \`phone\` varchar(255) NOT NULL
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_student\`
            ADD UNIQUE INDEX \`IDX_676b4997ee835fa293b57029bd\` (\`phone\`)
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_student\` CHANGE \`user_name\` \`user_name\` varchar(255) NOT NULL
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_student\` DROP COLUMN \`psalt\`
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_student\`
            ADD \`psalt\` varchar(255) NOT NULL
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_student\` DROP COLUMN \`user_id\`
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_student\`
            ADD \`user_id\` int NOT NULL
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_student\` CHANGE \`student_type\` \`student_type\` int NOT NULL DEFAULT '1'
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_student\` CHANGE \`start_at\` \`start_at\` datetime NOT NULL
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_student\` CHANGE \`expire_at\` \`expire_at\` datetime NOT NULL
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_student\` DROP COLUMN \`status\`
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_student\`
            ADD \`status\` int NOT NULL DEFAULT '1'
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_student_class\` CHANGE \`id\` \`id\` bigint UNSIGNED NOT NULL COMMENT '主键'
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_student_class\` DROP PRIMARY KEY
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_student_class\` DROP COLUMN \`id\`
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_student_class\`
            ADD \`id\` int NOT NULL PRIMARY KEY AUTO_INCREMENT
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_student_class\` DROP COLUMN \`is_delete\`
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_student_class\`
            ADD \`is_delete\` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6)
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_student_class\` DROP COLUMN \`student_id\`
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_student_class\`
            ADD \`student_id\` int NOT NULL
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_student_class\` DROP COLUMN \`class_id\`
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_student_class\`
            ADD \`class_id\` int NOT NULL
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_book_tag\` CHANGE \`id\` \`id\` bigint UNSIGNED NOT NULL COMMENT '主键'
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_book_tag\` DROP PRIMARY KEY
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_book_tag\` DROP COLUMN \`id\`
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_book_tag\`
            ADD \`id\` int NOT NULL PRIMARY KEY AUTO_INCREMENT
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_book_tag\` DROP COLUMN \`is_delete\`
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_book_tag\`
            ADD \`is_delete\` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6)
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_video\` CHANGE \`id\` \`id\` bigint UNSIGNED NOT NULL COMMENT '主键'
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_video\` DROP PRIMARY KEY
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_video\` DROP COLUMN \`id\`
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_video\`
            ADD \`id\` int NOT NULL PRIMARY KEY AUTO_INCREMENT
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_video\` DROP COLUMN \`is_delete\`
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_video\`
            ADD \`is_delete\` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6)
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_video\` DROP COLUMN \`video_season\`
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_video\`
            ADD \`video_season\` int NOT NULL COMMENT '视频季数' DEFAULT '0'
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_video\` DROP COLUMN \`video_no\`
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_video\`
            ADD \`video_no\` int NOT NULL COMMENT '视频集数' DEFAULT '0'
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_video\` CHANGE \`video_srt_url\` \`video_srt_url\` varchar(255) NOT NULL COMMENT '字幕文件链接' DEFAULT ''
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_video\` CHANGE \`video_srt_type\` \`video_srt_type\` tinyint NOT NULL COMMENT '字幕类型，1 人工字幕 2 AI字幕' DEFAULT '1'
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_book\` CHANGE \`id\` \`id\` bigint UNSIGNED NOT NULL COMMENT '主键'
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_book\` DROP PRIMARY KEY
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_book\` DROP COLUMN \`id\`
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_book\`
            ADD \`id\` int NOT NULL PRIMARY KEY AUTO_INCREMENT
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_book\` DROP COLUMN \`is_delete\`
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_book\`
            ADD \`is_delete\` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6)
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_book\` DROP COLUMN \`book_audio_urls\`
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_book\`
            ADD \`book_audio_urls\` text NULL COMMENT '书本音频文件'
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_book\` CHANGE \`book_split_type\` \`book_split_type\` tinyint NOT NULL COMMENT '音频切割类型，1 人工字幕 2 AI字幕' DEFAULT '1'
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_user\` CHANGE \`id\` \`id\` bigint UNSIGNED NOT NULL COMMENT '主键'
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_user\` DROP PRIMARY KEY
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_user\` DROP COLUMN \`id\`
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_user\`
            ADD \`id\` int NOT NULL PRIMARY KEY AUTO_INCREMENT
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_user\` DROP COLUMN \`is_delete\`
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_user\`
            ADD \`is_delete\` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6)
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_user\` CHANGE \`user_id\` \`user_id\` varchar(255) NOT NULL
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_user\` CHANGE \`phone\` \`phone\` varchar(255) NOT NULL
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_user\`
            ADD UNIQUE INDEX \`IDX_ec2be3186417303cb1287472ec\` (\`phone\`)
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_user\` CHANGE \`user_name\` \`user_name\` varchar(255) NOT NULL
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_user\` CHANGE \`guarder\` \`guarder\` varchar(255) NOT NULL COMMENT '监护人'
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_user\` CHANGE \`guarder_phone\` \`guarder_phone\` varchar(255) NOT NULL COMMENT '监护人电话'
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_user\` CHANGE \`guarder_relation\` \`guarder_relation\` int NOT NULL COMMENT '与监护人关系，0 未知 1 爸爸 2 妈妈 3 爷爷 4 奶奶 5 外公 6 外婆' DEFAULT '0'
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_user\` CHANGE \`school\` \`school\` varchar(255) NOT NULL COMMENT '学校'
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_user\` CHANGE \`province\` \`province\` varchar(255) NOT NULL COMMENT '省份'
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_user\` CHANGE \`city\` \`city\` varchar(255) NOT NULL COMMENT '城市'
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_user\` CHANGE \`status\` \`status\` int NOT NULL COMMENT '用户阶段，1 线索 2 机会用户 3 已付费未激活 4 付费一年 5 一年未续费' DEFAULT '1'
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_user\` CHANGE \`mark\` \`mark\` varchar(255) NOT NULL COMMENT '备注'
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_user_history\` DROP COLUMN \`created_at\`
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_user_history\`
            ADD \`created_at\` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6)
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_user_history\` DROP COLUMN \`updated_at\`
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_user_history\`
            ADD \`updated_at\` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6)
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_user_history\` CHANGE \`user_id\` \`user_id\` int NOT NULL COMMENT '关联的用户ID'
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_user_history\` CHANGE \`editor_id\` \`editor_id\` int NOT NULL COMMENT '编辑者ID'
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_user_history\` CHANGE \`editor_name\` \`editor_name\` varchar(255) NOT NULL COMMENT '编辑者姓名' DEFAULT ''
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_user_history\` CHANGE \`status_before\` \`status_before\` int NULL COMMENT '编辑前的用户阶段'
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_user_history\` CHANGE \`status_after\` \`status_after\` int NOT NULL COMMENT '编辑后的用户阶段'
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_user_history\` CHANGE \`mark_before\` \`mark_before\` text NULL COMMENT '编辑前的备注'
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_user_history\` CHANGE \`mark_after\` \`mark_after\` text NOT NULL COMMENT '编辑后的备注'
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_user_history\` CHANGE \`changes\` \`changes\` text NULL COMMENT '其他修改内容摘要'
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_video_tag\` CHANGE \`id\` \`id\` bigint UNSIGNED NOT NULL COMMENT '主键'
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_video_tag\` DROP PRIMARY KEY
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_video_tag\` DROP COLUMN \`id\`
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_video_tag\`
            ADD \`id\` int NOT NULL PRIMARY KEY AUTO_INCREMENT
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_video_tag\` DROP COLUMN \`is_delete\`
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_video_tag\`
            ADD \`is_delete\` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6)
        `);
        await queryRunner.query(`
            CREATE UNIQUE INDEX \`REL_1298b95c8b138ab223bd8c1529\` ON \`sys_refresh_tokens\` (\`accessTokenId\`)
        `);
        await queryRunner.query(`
            ALTER TABLE \`sys_refresh_tokens\`
            ADD CONSTRAINT \`FK_1298b95c8b138ab223bd8c15297\` FOREIGN KEY (\`accessTokenId\`) REFERENCES \`sys_access_tokens\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION
        `);
        await queryRunner.query(`
            ALTER TABLE \`sys_access_tokens\`
            ADD CONSTRAINT \`FK_3bcbdd70705cb317027cea23e6c\` FOREIGN KEY (\`user_id\`) REFERENCES \`sys_user\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION
        `);
    }

    public async down(queryRunner: QueryRunner): Promise<void> {
        await queryRunner.query(`
            ALTER TABLE \`sys_access_tokens\` DROP FOREIGN KEY \`FK_3bcbdd70705cb317027cea23e6c\`
        `);
        await queryRunner.query(`
            ALTER TABLE \`sys_refresh_tokens\` DROP FOREIGN KEY \`FK_1298b95c8b138ab223bd8c15297\`
        `);
        await queryRunner.query(`
            DROP INDEX \`REL_1298b95c8b138ab223bd8c1529\` ON \`sys_refresh_tokens\`
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_video_tag\` DROP COLUMN \`is_delete\`
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_video_tag\`
            ADD \`is_delete\` tinyint NOT NULL COMMENT '逻辑删除 0 未删除，1 已删除' DEFAULT '0'
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_video_tag\` DROP COLUMN \`id\`
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_video_tag\`
            ADD \`id\` bigint UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键'
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_video_tag\`
            ADD PRIMARY KEY (\`id\`)
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_video_tag\` CHANGE \`id\` \`id\` bigint UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键'
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_user_history\` CHANGE \`changes\` \`changes\` text COLLATE "utf8mb4_unicode_ci" NULL COMMENT '其他变更内容'
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_user_history\` CHANGE \`mark_after\` \`mark_after\` text COLLATE "utf8mb4_unicode_ci" NULL COMMENT '修改后备注'
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_user_history\` CHANGE \`mark_before\` \`mark_before\` text COLLATE "utf8mb4_unicode_ci" NULL COMMENT '修改前备注'
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_user_history\` CHANGE \`status_after\` \`status_after\` int NOT NULL COMMENT '修改后状态' DEFAULT '0'
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_user_history\` CHANGE \`status_before\` \`status_before\` int NOT NULL COMMENT '修改前状态' DEFAULT '0'
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_user_history\` CHANGE \`editor_name\` \`editor_name\` varchar(255) COLLATE "utf8mb4_unicode_ci" NULL COMMENT '编辑者姓名' DEFAULT ''
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_user_history\` CHANGE \`editor_id\` \`editor_id\` int NOT NULL COMMENT '编辑者ID' DEFAULT '0'
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_user_history\` CHANGE \`user_id\` \`user_id\` int NOT NULL COMMENT '用户ID'
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_user_history\` DROP COLUMN \`updated_at\`
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_user_history\`
            ADD \`updated_at\` timestamp(0) NULL COMMENT '更新时间' DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_user_history\` DROP COLUMN \`created_at\`
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_user_history\`
            ADD \`created_at\` timestamp(0) NULL COMMENT '创建时间' DEFAULT CURRENT_TIMESTAMP
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_user\` CHANGE \`mark\` \`mark\` varchar(255) NOT NULL COMMENT '备注' DEFAULT ''
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_user\` CHANGE \`status\` \`status\` int NOT NULL COMMENT '用户阶段，1 线索  2 机会用户  3 已付费未激活  4 付费一年  5 一年未续费' DEFAULT '1'
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_user\` CHANGE \`city\` \`city\` varchar(255) NOT NULL COMMENT '城市' DEFAULT ''
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_user\` CHANGE \`province\` \`province\` varchar(255) NOT NULL COMMENT '省份' DEFAULT ''
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_user\` CHANGE \`school\` \`school\` varchar(255) NOT NULL COMMENT '学校' DEFAULT ''
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_user\` CHANGE \`guarder_relation\` \`guarder_relation\` int NOT NULL COMMENT '与监护人关系' DEFAULT '0'
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_user\` CHANGE \`guarder_phone\` \`guarder_phone\` varchar(255) NOT NULL COMMENT '监护人手机号' DEFAULT ''
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_user\` CHANGE \`guarder\` \`guarder\` varchar(255) NOT NULL COMMENT '监护人' DEFAULT ''
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_user\` CHANGE \`user_name\` \`user_name\` varchar(255) NOT NULL COMMENT '用户昵称/姓名' DEFAULT ''
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_user\` DROP INDEX \`IDX_ec2be3186417303cb1287472ec\`
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_user\` CHANGE \`phone\` \`phone\` varchar(255) NOT NULL COMMENT '手机号' DEFAULT ''
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_user\` CHANGE \`user_id\` \`user_id\` varchar(255) NOT NULL COMMENT '用户ID' DEFAULT ''
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_user\` DROP COLUMN \`is_delete\`
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_user\`
            ADD \`is_delete\` tinyint NOT NULL COMMENT '逻辑删除 0 未删除，1 已删除' DEFAULT '0'
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_user\` DROP COLUMN \`id\`
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_user\`
            ADD \`id\` bigint UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键'
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_user\`
            ADD PRIMARY KEY (\`id\`)
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_user\` CHANGE \`id\` \`id\` bigint UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键'
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_book\` CHANGE \`book_split_type\` \`book_split_type\` tinyint NOT NULL COMMENT '音频切割类型，1 人工字幕  2 AI字幕' DEFAULT '1'
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_book\` DROP COLUMN \`book_audio_urls\`
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_book\`
            ADD \`book_audio_urls\` json NULL COMMENT '书本音频文件列表'
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_book\` DROP COLUMN \`is_delete\`
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_book\`
            ADD \`is_delete\` tinyint NOT NULL COMMENT '逻辑删除 0 未删除，1 已删除' DEFAULT '0'
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_book\` DROP COLUMN \`id\`
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_book\`
            ADD \`id\` bigint UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键'
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_book\`
            ADD PRIMARY KEY (\`id\`)
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_book\` CHANGE \`id\` \`id\` bigint UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键'
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_video\` CHANGE \`video_srt_type\` \`video_srt_type\` tinyint NOT NULL COMMENT '视频字幕类型，1 人工字幕  2 AI字幕' DEFAULT '1'
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_video\` CHANGE \`video_srt_url\` \`video_srt_url\` varchar(255) NOT NULL COMMENT '视频字幕链接' DEFAULT ''
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_video\` DROP COLUMN \`video_no\`
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_video\`
            ADD \`video_no\` varchar(255) NOT NULL COMMENT '视频集数' DEFAULT ''
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_video\` DROP COLUMN \`video_season\`
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_video\`
            ADD \`video_season\` varchar(255) NOT NULL COMMENT '视频季数' DEFAULT ''
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_video\` DROP COLUMN \`is_delete\`
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_video\`
            ADD \`is_delete\` tinyint NOT NULL COMMENT '逻辑删除 0 未删除，1 已删除' DEFAULT '0'
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_video\` DROP COLUMN \`id\`
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_video\`
            ADD \`id\` bigint UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键'
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_video\`
            ADD PRIMARY KEY (\`id\`)
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_video\` CHANGE \`id\` \`id\` bigint UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键'
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_book_tag\` DROP COLUMN \`is_delete\`
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_book_tag\`
            ADD \`is_delete\` tinyint NOT NULL COMMENT '逻辑删除 0 未删除，1 已删除' DEFAULT '0'
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_book_tag\` DROP COLUMN \`id\`
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_book_tag\`
            ADD \`id\` bigint UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键'
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_book_tag\`
            ADD PRIMARY KEY (\`id\`)
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_book_tag\` CHANGE \`id\` \`id\` bigint UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键'
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_student_class\` DROP COLUMN \`class_id\`
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_student_class\`
            ADD \`class_id\` bigint UNSIGNED NOT NULL COMMENT '班级ID' DEFAULT '0'
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_student_class\` DROP COLUMN \`student_id\`
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_student_class\`
            ADD \`student_id\` bigint UNSIGNED NOT NULL COMMENT '学生账号id' DEFAULT '0'
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_student_class\` DROP COLUMN \`is_delete\`
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_student_class\`
            ADD \`is_delete\` tinyint NOT NULL COMMENT '逻辑删除 0 未删除，1 已删除' DEFAULT '0'
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_student_class\` DROP COLUMN \`id\`
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_student_class\`
            ADD \`id\` bigint UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键'
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_student_class\`
            ADD PRIMARY KEY (\`id\`)
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_student_class\` CHANGE \`id\` \`id\` bigint UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键'
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_student\` DROP COLUMN \`status\`
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_student\`
            ADD \`status\` tinyint NULL COMMENT '是否有效，1 有效 0 无效' DEFAULT '1'
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_student\` CHANGE \`expire_at\` \`expire_at\` datetime NOT NULL COMMENT '结束时间'
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_student\` CHANGE \`start_at\` \`start_at\` datetime NOT NULL COMMENT '开始时间'
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_student\` CHANGE \`student_type\` \`student_type\` int NOT NULL COMMENT '学习方式，1 线上学习 2 线下学习' DEFAULT '1'
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_student\` DROP COLUMN \`user_id\`
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_student\`
            ADD \`user_id\` bigint UNSIGNED NOT NULL COMMENT '关联用户' DEFAULT '0'
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_student\` DROP COLUMN \`psalt\`
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_student\`
            ADD \`psalt\` varchar(32) NOT NULL
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_student\` CHANGE \`user_name\` \`user_name\` varchar(255) NOT NULL COMMENT '用户昵称/姓名' DEFAULT ''
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_student\` DROP INDEX \`IDX_676b4997ee835fa293b57029bd\`
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_student\` CHANGE \`phone\` \`phone\` varchar(255) NOT NULL COMMENT '手机号' DEFAULT ''
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_student\` CHANGE \`student_id\` \`student_id\` varchar(255) NOT NULL COMMENT '登陆用户ID' DEFAULT ''
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_student\` CHANGE \`update_by\` \`update_by\` int NOT NULL COMMENT '更新者' DEFAULT '0'
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_student\` CHANGE \`create_by\` \`create_by\` int NOT NULL COMMENT '创建者' DEFAULT '0'
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_student\` DROP COLUMN \`is_delete\`
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_student\`
            ADD \`is_delete\` tinyint NOT NULL COMMENT '逻辑删除 0 未删除，1 已删除' DEFAULT '0'
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_student\` DROP COLUMN \`id\`
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_student\`
            ADD \`id\` bigint UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键'
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_student\`
            ADD PRIMARY KEY (\`id\`)
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_student\` CHANGE \`id\` \`id\` bigint UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键'
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_student_expire_log\` CHANGE \`expire_at\` \`expire_at\` datetime NOT NULL COMMENT '结束时间'
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_student_expire_log\` CHANGE \`start_at\` \`start_at\` datetime NOT NULL COMMENT '开始时间'
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_student_expire_log\` DROP COLUMN \`student_id\`
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_student_expire_log\`
            ADD \`student_id\` bigint UNSIGNED NOT NULL COMMENT '学生账号' DEFAULT '0'
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_student_expire_log\` DROP COLUMN \`id\`
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_student_expire_log\`
            ADD \`id\` bigint UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键'
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_student_expire_log\`
            ADD PRIMARY KEY (\`id\`)
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_student_expire_log\` CHANGE \`id\` \`id\` bigint UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键'
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_class\` DROP COLUMN \`status\`
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_class\`
            ADD \`status\` tinyint NULL DEFAULT '1'
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_class\` CHANGE \`class_teacher\` \`class_teacher\` int NOT NULL COMMENT '带班老师' DEFAULT '0'
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_class\` CHANGE \`class_name\` \`class_name\` varchar(255) NOT NULL COMMENT '班级名称' DEFAULT ''
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_class\` DROP INDEX \`IDX_66724669c486d7566404765d01\`
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_class\` CHANGE \`class_id\` \`class_id\` varchar(255) NOT NULL COMMENT '班级ID' DEFAULT ''
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_class\` DROP COLUMN \`id\`
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_class\`
            ADD \`id\` bigint UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键'
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_class\`
            ADD PRIMARY KEY (\`id\`)
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_class\` CHANGE \`id\` \`id\` bigint UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键'
        `);
        await queryRunner.query(`
            ALTER TABLE \`sys_asr_task\` DROP COLUMN \`is_delete\`
        `);
        await queryRunner.query(`
            ALTER TABLE \`sys_asr_task\`
            ADD \`is_delete\` tinyint NOT NULL COMMENT '逻辑删除 0 未删除，1 已删除' DEFAULT '0'
        `);
        await queryRunner.query(`
            ALTER TABLE \`sys_asr_task\` DROP COLUMN \`id\`
        `);
        await queryRunner.query(`
            ALTER TABLE \`sys_asr_task\`
            ADD \`id\` bigint UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键'
        `);
        await queryRunner.query(`
            ALTER TABLE \`sys_asr_task\`
            ADD PRIMARY KEY (\`id\`)
        `);
        await queryRunner.query(`
            ALTER TABLE \`sys_asr_task\` CHANGE \`id\` \`id\` bigint UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键'
        `);
        await queryRunner.query(`
            ALTER TABLE \`sys_ocr_task\` DROP COLUMN \`is_delete\`
        `);
        await queryRunner.query(`
            ALTER TABLE \`sys_ocr_task\`
            ADD \`is_delete\` tinyint NOT NULL COMMENT '逻辑删除 0 未删除，1 已删除' DEFAULT '0'
        `);
        await queryRunner.query(`
            ALTER TABLE \`sys_ocr_task\` DROP COLUMN \`id\`
        `);
        await queryRunner.query(`
            ALTER TABLE \`sys_ocr_task\`
            ADD \`id\` bigint UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键'
        `);
        await queryRunner.query(`
            ALTER TABLE \`sys_ocr_task\`
            ADD PRIMARY KEY (\`id\`)
        `);
        await queryRunner.query(`
            ALTER TABLE \`sys_ocr_task\` CHANGE \`id\` \`id\` bigint UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键'
        `);
        await queryRunner.query(`
            ALTER TABLE \`sys_role\` CHANGE \`value\` \`value\` varchar(255) NOT NULL
        `);
        await queryRunner.query(`
            ALTER TABLE \`sys_role\` CHANGE \`update_by\` \`update_by\` int NOT NULL COMMENT '更新者'
        `);
        await queryRunner.query(`
            ALTER TABLE \`sys_role\` CHANGE \`create_by\` \`create_by\` int NOT NULL COMMENT '创建者'
        `);
        await queryRunner.query(`
            ALTER TABLE \`sys_user\` DROP INDEX \`IDX_7bef5cdb09432b1dfc46a063ce\`
        `);
        await queryRunner.query(`
            ALTER TABLE \`sys_user\` CHANGE \`phone\` \`phone\` varchar(255) NULL
        `);
        await queryRunner.query(`
            ALTER TABLE \`sys_refresh_tokens\` DROP INDEX \`IDX_1298b95c8b138ab223bd8c1529\`
        `);
        await queryRunner.query(`
            ALTER TABLE \`sys_refresh_tokens\` CHANGE \`accessTokenId\` \`accessTokenId\` varchar(36) COLLATE "utf8mb4_unicode_ci" NULL
        `);
        await queryRunner.query(`
            ALTER TABLE \`sys_menu\` CHANGE \`update_by\` \`update_by\` int NOT NULL COMMENT '更新者'
        `);
        await queryRunner.query(`
            ALTER TABLE \`sys_menu\` CHANGE \`create_by\` \`create_by\` int NOT NULL COMMENT '创建者'
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_student_class\` DROP COLUMN \`last_checkin_at\`
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_student_class\` DROP COLUMN \`checkin_days\`
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_student_class\` DROP COLUMN \`join_at\`
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_class\` DROP COLUMN \`study_plan\`
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_user\`
            ADD \`age\` int NULL COMMENT '年龄'
        `);
        await queryRunner.query(`
            ALTER TABLE \`c_student\`
            ADD \`join_at\` datetime NULL COMMENT '加入班级时间'
        `);
        await queryRunner.query(`
            CREATE INDEX \`idx_user_id\` ON \`c_user_history\` (\`user_id\`)
        `);
        await queryRunner.query(`
            CREATE INDEX \`idx_editor_id\` ON \`c_user_history\` (\`editor_id\`)
        `);
        await queryRunner.query(`
            CREATE INDEX \`idx_created_at\` ON \`c_user_history\` (\`created_at\`)
        `);
        await queryRunner.query(`
            CREATE UNIQUE INDEX \`idx_c_user_id\` ON \`c_user\` (\`user_id\`)
        `);
        await queryRunner.query(`
            CREATE INDEX \`idx_c_student_phone\` ON \`c_user\` (\`phone\`)
        `);
        await queryRunner.query(`
            CREATE INDEX \`idx_student_id\` ON \`c_student_class\` (\`student_id\`)
        `);
        await queryRunner.query(`
            CREATE INDEX \`idx_class_id\` ON \`c_student_class\` (\`student_id\`, \`is_delete\`)
        `);
        await queryRunner.query(`
            CREATE UNIQUE INDEX \`idx_student_phone\` ON \`c_student\` (\`phone\`)
        `);
        await queryRunner.query(`
            CREATE INDEX \`idx_student_id\` ON \`c_student_expire_log\` (\`student_id\`)
        `);
        await queryRunner.query(`
            CREATE UNIQUE INDEX \`idx_class_id\` ON \`c_class\` (\`class_id\`)
        `);
        await queryRunner.query(`
            CREATE INDEX \`idx_url\` ON \`sys_asr_task\` (\`url\`)
        `);
        await queryRunner.query(`
            CREATE INDEX \`idx_task_id\` ON \`sys_asr_task\` (\`task_id\`, \`task_type\`, \`is_delete\`)
        `);
        await queryRunner.query(`
            CREATE UNIQUE INDEX \`IDX_9e7164b2f1ea1348bc0eb0a7da\` ON \`sys_user\` (\`phone\`)
        `);
        await queryRunner.query(`
            CREATE UNIQUE INDEX \`REL_1dfd080c2abf42198691b60ae3\` ON \`sys_refresh_tokens\` (\`accessTokenId\`)
        `);
        await queryRunner.query(`
            ALTER TABLE \`sys_access_tokens\`
            ADD CONSTRAINT \`FK_e9d9d0c303432e4e5e48c1c3e90\` FOREIGN KEY (\`user_id\`) REFERENCES \`sys_user\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION
        `);
        await queryRunner.query(`
            ALTER TABLE \`sys_refresh_tokens\`
            ADD CONSTRAINT \`FK_1dfd080c2abf42198691b60ae39\` FOREIGN KEY (\`accessTokenId\`) REFERENCES \`sys_access_tokens\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION
        `);
    }

}
